﻿HmJS.$Import('util.effect.Scroller');
//HmJS.$Import('core.domready');

HmJS.register('demo.module.util.effect.scroller', function ($ns) {
	var that = {};

	that.todo = function () {
		var autos = true;
		var Scroller = $ns.util.effect.Scroller;
		Demo.scv = new Scroller($('scrollVert'), { duration: 500, autostart: autos, autostart_dir: "back", leftm: 1, topm: 1 });
		Demo.sch = new Scroller($('scrollHor'), { duration: 250, autostart: autos, selectBy: 'class', sleep: 1000 });
		Demo.scc = new Scroller($('scrollc'), { duration: 250, autostart: autos, sleep: 1000, leftm: 1, topm: 1, selectBy: 'class' });
		Demo.scd = new Scroller($('scrolld'), { duration: 250, autostart: autos, sleep: 1000, leftm: 1, topm: 1, selectBy: 'class' });

		$('prev').addEvent('click', function () {
			Demo.sch.prev();
		});

		$('next').addEvent('click', function () {
			Demo.sch.next();
		});

		$('stop').addEvent('click', function () {
			Demo.sch.stop();
		});

		$('startback').addEvent('click', function () {
			Demo.sch.start(true);
		});

		$('start').addEvent('click', function () {
			Demo.sch.start();
		});

		$('change').addEvent('click', function () {
			Demo.sch.updateTransition({ duration: 100, sleep: 5000 });
		});
	};

	return that;
});
